/* 
 * File:   GridIterator.h
 * Author: eliana
 *
 * Created on October 20, 2012, 7:50 PM
 */

#ifndef GRID_ITERATOR_H
#define	GRID_ITERATOR_H

#include "Ray.h"
#include "Grid.h"
#include "GridCell.h"

class GridIterator 
{
public:
    
    /**
     * Constructor
     * @param[in] grid Pointer to the grid
     * @param[in] ray Ray that will guide the iteration
     */
    GridIterator( Ray& ray );
    
    /**
     * Destructor
     */
    virtual ~GridIterator();
    
    /**
     * @return True if the iteration is finished, false otherwise
     */
    bool finished();
    
    /**
     * @return Next cell intercepted by the ray
     */
    virtual GridCell* next() = 0;
    
protected:
    
    /** Ray that will guide the iteration */
    Ray* _ray;
    
    /** True if the iteration is finished, false otherwise */
    bool _finished;
};

#endif	/* GRIDITERATOR_H */

